{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "销售经理（公寓产品）\n",
      "{'https://www.liepin.com/job/1915824093.shtml'}\n",
      "手游产品运营经理\n",
      "{'https://www.liepin.com/job/1916599857.shtml'}\n",
      "产品经理/产品工程师\n",
      "{'https://www.liepin.com/job/1912074862.shtml'}\n",
      "产品经理\n",
      "{'https://www.liepin.com/job/1926798013.shtml'}\n",
      "产品设计经理\n",
      "{'https://www.liepin.com/job/1926670753.shtml'}\n",
      "后台产品经理\n",
      "{'https://www.liepin.com/job/1926738041.shtml'}\n",
      "银行产品经理\n",
      "{'https://www.liepin.com/job/1926801671.shtml'}\n",
      "产品经理\n",
      "{'https://www.liepin.com/job/1926892793.shtml'}\n",
      "招商经理（电商3C产品）\n",
      "{'https://www.liepin.com/job/1926887387.shtml'}\n",
      "产品设计（经理级 双休）\n",
      "{'https://www.liepin.com/job/1926870253.shtml'}\n",
      "GIS产品经理\n",
      "{'https://www.liepin.com/job/1926820317.shtml'}\n",
      "专利产品经理\n",
      "{'https://www.liepin.com/job/1926787487.shtml'}\n",
      "产品经理（精益相关）\n",
      "{'https://www.liepin.com/job/1926741987.shtml'}\n",
      "销售系统产品经理\n",
      "{'https://www.liepin.com/job/1926721203.shtml'}\n",
      "产品经理助理\n",
      "{'https://www.liepin.com/job/1926714491.shtml'}\n",
      "法务经理-硬件产品支持方向\n",
      "{'https://www.liepin.com/job/1924373109.shtml'}\n",
      "产品运营副经理\n",
      "{'https://www.liepin.com/job/1926717557.shtml'}\n",
      "资深产品经理（丁香医生）\n",
      "{'https://www.liepin.com/job/1926237339.shtml'}\n",
      "策略产品经理\n",
      "{'https://www.liepin.com/job/1926203195.shtml'}\n",
      "产品经理\n",
      "{'https://www.liepin.com/job/1926150571.shtml'}\n",
      "产品经理\n",
      "{'https://www.liepin.com/job/1925009149.shtml'}\n",
      "产品经理\n",
      "{'https://www.liepin.com/job/1924778975.shtml'}\n",
      "金融产品销售经理9179\n",
      "{'https://www.liepin.com/job/1923676571.shtml'}\n",
      "产品经理（用户分析方向）\n",
      "{'https://www.liepin.com/job/1926332867.shtml'}\n",
      "BI产品经理（投研大数据）\n",
      "{'https://www.liepin.com/job/1926843083.shtml'}\n",
      "后装产品经理(J10475)\n",
      "{'https://www.liepin.com/job/1926842751.shtml'}\n",
      "软件产品经理(J10474)\n",
      "{'https://www.liepin.com/job/1926842665.shtml'}\n",
      "产业业务部-产品经理岗\n",
      "{'https://www.liepin.com/job/1926838911.shtml'}\n",
      "产品经理\n",
      "{'https://www.liepin.com/job/1926837003.shtml'}\n",
      "产品经理\n",
      "{'https://www.liepin.com/job/1926836871.shtml'}\n",
      "产品主管/经理\n",
      "{'https://www.liepin.com/job/1926833823.shtml'}\n",
      "风险产品经理\n",
      "{'https://www.liepin.com/job/1926824701.shtml'}\n",
      "万达普惠-互联网产品经理\n",
      "{'https://www.liepin.com/job/1926816405.shtml'}\n",
      "高级产品经理（互联网）\n",
      "{'https://www.liepin.com/job/1926562165.shtml'}\n",
      "高级产品经理\n",
      "{'https://www.liepin.com/job/1925362781.shtml'}\n",
      "产品经理\n",
      "{'https://www.liepin.com/job/1925206267.shtml'}\n",
      "产品引入商务经理\n",
      "{'https://www.liepin.com/job/1916909411.shtml'}\n",
      "对公产品经理（投行、贸融、网金、离岸、信托）\n",
      "{'https://www.liepin.com/job/199532676.shtml'}\n",
      "旅游产品经理\n",
      "{'https://www.liepin.com/job/1926703515.shtml'}\n",
      "互联网产品经理\n",
      "{'https://www.liepin.com/job/1926483249.shtml'}\n"
     ]
    }
   ],
   "source": [
    "from requests_html import HTMLSession\n",
    "\n",
    "session = HTMLSession()\n",
    "\n",
    "r = session.get(\"https://www.liepin.com/zhaopin/?key=产品经理\")\n",
    "\n",
    "# 通过xpath找到工作标签\n",
    "news = r.html.xpath('//div[@class=\"job-info\"]/h3/a')\n",
    "#                    //→往下找所有元素(不分层的所有元素) /→一层\n",
    "#                    []→去条件（符合条件的内容）\n",
    "#                   @attribute按照属性找\n",
    "\n",
    "for new in news:\n",
    "    print(new.text)  # 获得工作标题\n",
    "    print(new.absolute_links)  # 获得工作链接"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1、尝试只显示工作岗位"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "后台产品经理\n",
      "产品运营副经理\n",
      "销售系统产品经理\n",
      "产品经理\n",
      "产品经理(电商方向）\n",
      "产品设计经理\n",
      "策略产品经理\n",
      "产品经理\n",
      "招商经理（电商3C产品）\n",
      "产品设计（经理级 双休）\n",
      "GIS产品经理\n",
      "专利产品经理\n",
      "产品经理（精益相关）\n",
      "产品经理助理\n",
      "法务经理-硬件产品支持方向\n",
      "资深产品经理（丁香医生）\n",
      "产品经理\n",
      "产品经理\n",
      "产品经理\n",
      "金融产品销售经理9179\n",
      "产品经理（用户分析方向）\n",
      "BI产品经理（投研大数据）\n",
      "后装产品经理(J10475)\n",
      "软件产品经理(J10474)\n",
      "产业业务部-产品经理岗\n",
      "产品经理\n",
      "产品经理\n",
      "产品主管/经理\n",
      "风险产品经理\n",
      "万达普惠-互联网产品经理\n",
      "高级产品经理（互联网）\n",
      "高级产品经理\n",
      "产品经理\n",
      "产品引入商务经理\n",
      "手游产品运营经理\n",
      "对公产品经理（投行、贸融、网金、离岸、信托）\n",
      "银行产品经理\n",
      "旅游产品经理\n",
      "产品经理\n",
      "互联网产品经理\n"
     ]
    }
   ],
   "source": [
    "from requests_html import HTMLSession\n",
    "\n",
    "session = HTMLSession()\n",
    "\n",
    "r = session.get(\"https://www.liepin.com/zhaopin/?key=产品经理\")\n",
    "\n",
    "news = r.html.xpath('//div[@class=\"job-info\"]/h3/a')\n",
    "\n",
    "\n",
    "for new in news:\n",
    "    print(new.text)  # 获得工作标题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "2、获取Element对象内的特定子Element对象，返回列表:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<Element 'img' alt='' src='//js.588ku.com/comp/activity/commonVip/images/compay-nav-down.png?v=202003181004' style='display:block;border-radius: 8px;' width='100%'>\n",
      "<Element 'img' alt='' onclick='comnewVipClick(1,1)' src='//js.588ku.com/comp/activity/commonVip/images/indexcomp.png?v=20200318' style='display: block;' width='100%'>\n",
      "<Element 'img' alt='千库网' src='//static.588ku.com/imgPath/index/images/indexdialogV2.png?v=190808' title='千库网'>\n",
      "<Element 'img' alt='' src='//js.588ku.com/comp/activity/commonVip/images/compay-nav-down.png?v=202003181004' style='display:block;border-radius: 8px;' width='100%'>\n",
      "<Element 'img' alt='' onclick='comnewVipClick(1,1)' src='//js.588ku.com/comp/activity/commonVip/images/indexcomp.png?v=20200318' style='display: block;' width='100%'>\n",
      "<Element 'img' alt='' src='//bpic.588ku.com/element_banner/20/20/03/bf50c4330dbb98521976888daf9e9f21.jpg!/unsharp/true/compress/true' title=''>\n",
      "<Element 'img' alt='视频·4K原创实拍' src='//bpic.588ku.com/element_banner/20/20/03/f3c67461bf0a370d7c40b5dc37b5e044.jpg' title='视频·4K原创实拍'>\n",
      "<Element 'img' alt='艺术字·招聘' src='//bpic.588ku.com/element_banner/20/20/03/7a6a674952bec13413282e65fc23ab32.jpg' title='艺术字·招聘'>\n",
      "<Element 'img' alt='摄影图·春天的希望' src='//bpic.588ku.com/element_banner/20/20/03/b61cf2b1759004cd6b03ed0f52550172.jpg' title='摄影图·春天的希望'>\n",
      "<Element 'img' alt='GIF·新媒体素材' src='//bpic.588ku.com/element_banner/20/20/03/167a91a7e6d6899cb9db594b9e538e17.gif' title='GIF·新媒体素材'>\n",
      "<Element 'img' alt='直播免抠图' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/12/b61384a187965af817c18cfca8566383.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='直播免抠图'>\n",
      "<Element 'img' alt='花卉免抠图' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/17/597d702d8e315ccc6879b3300902558b.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='花卉免抠图'>\n",
      "<Element 'img' alt='笔刷免抠图' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/12/03b61a19cb6a4617b53fa602fab5202f.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='笔刷免抠图'>\n",
      "<Element 'img' alt='底纹' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/27/53f3541092071b4a782ee3584f9099a4.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='底纹'>\n",
      "<Element 'img' alt='防疫表情包' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/16/40b2a5284c27a2e6eca7d96e2a6314da.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='防疫表情包'>\n",
      "<Element 'img' alt='消毒免抠图' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/27/2d3000ad42fece77ecfc4416cdcc632f.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='消毒免抠图'>\n",
      "<Element 'img' alt='医生免抠图' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/09/3bce2f97a0dd67b33aea1d1dac520df2.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='医生免抠图'>\n",
      "<Element 'img' alt='口罩免抠图' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/27/d012d5ca392e9b54b67d5e421ba1b56f.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='口罩免抠图'>\n",
      "<Element 'img' alt='免抠图标' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/01/15/4acc1d9ab373f52bdcd137bf80bc0cdf.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='免抠图标'>\n",
      "<Element 'img' alt='果蔬免抠摄影' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/21/cea6603d973fa5179f34c9276e686fe3.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='果蔬免抠摄影'>\n",
      "<Element 'img' alt='' class=('small-img', 'lazy') src=''>\n",
      "<Element 'img' alt='' class=('small-img', 'lazy') src=''>\n",
      "<Element 'img' alt='' class=('img', 'lazy') src='//js.588ku.com/comp/base/images/lz.png'>\n",
      "<Element 'img' alt='春暖花开' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/13/ffc9589ed137bbd062355758409fa496.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='春暖花开'>\n",
      "<Element 'img' alt='春天精选' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/02/861b7de4d5b84cb98975c8071ded9e57.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='春天精选'>\n",
      "<Element 'img' alt='战疫' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/13/20e8e0cdb6315ec3f1a93e5e84288eb5.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='战疫'>\n",
      "<Element 'img' alt='复工' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/20/92320624ed301905502ff88d41c66437.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='复工'>\n",
      "<Element 'img' alt='生日快乐' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/01/07/27209976d5af920858d970304b49e89a.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='生日快乐'>\n",
      "<Element 'img' alt='温馨提示' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/15/416730ef142cb1f65581b53e8c3f69f8.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='温馨提示'>\n",
      "<Element 'img' alt='直播' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/13/b329f51080faabbfaf821a210eb18c16.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='直播'>\n",
      "<Element 'img' alt='早安' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/13/ca8ccdb8d88f908c6a98748887ed9f4d.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='早安'>\n",
      "<Element 'img' alt='综艺花字' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/13/9143d8e72ce12a0d5246c4cc543b0476.png!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='综艺花字'>\n",
      "<Element 'img' alt='数字合集-创意' class=('lazy',) data-original='//bpic.588ku.com/art_pic/19/03/18/d149de91dc818232430c0c90a8b941a3.jpg!/fw/250/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='数字合集-创意'>\n",
      "<Element 'img' alt='\\t抗击疫情' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/23/bcc12f9c3770fd3bef6115f10b53c3a6.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='\\t抗击疫情'>\n",
      "<Element 'img' alt='C4D三维插画' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/23/8cf18e5118e9728032683ab9c97a70fa.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='C4D三维插画'>\n",
      "<Element 'img' alt='清新肌理' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/16/c63b3940286597f57bcb0f1e920e64fc.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='清新肌理'>\n",
      "<Element 'img' alt='通用·招聘' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/23/b6276b5815f48f2a65a8657cd6c076db.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='通用·招聘'>\n",
      "<Element 'img' alt='城市背景' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/23/5ecc3b6f5adc635236293053dd259aba.png!/fw/654/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='城市背景'>\n",
      "<Element 'img' alt='春光无限好' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/23/ef124525236070104bcfa95e15b8b779.png!/fw/654/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='春光无限好'>\n",
      "<Element 'img' alt='清明节' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/21/4d7b02b515691a6877acc63da9d864bc.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='清明节'>\n",
      "<Element 'img' alt='春天你好' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/23/6da3d464ae2078d0660c6bd625513649.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='春天你好'>\n",
      "<Element 'img' alt='招聘' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/23/e1be7d91732a8fbefec56d5f847d82f3.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='招聘'>\n",
      "<Element 'img' alt='春季美食' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/23/befaf02a32e50f2297f28b98cc172cc8.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='春季美食'>\n",
      "<Element 'img' alt='精品装饰画' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/09/5677cdc3fdd8539e461a54f7de68b9e8.png!/quality/98/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='精品装饰画'>\n",
      "<Element 'img' alt='精选画册' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/11/dfbc2c3978e7899911f374844126da20.png!/quality/98/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='精选画册'>\n",
      "<Element 'img' alt='公众号文章分割线动图' class=('lazy',) data-original='//wimg.588ku.com/gif/20/01/03/85f417ee6cd1ff534845b9967a6f8660.gif?imageView2/2/w/277' src='//js.588ku.com/comp/base/images/lz.gif' title='公众号文章分割线动图'>\n",
      "<Element 'img' alt='春暖花开战役胜利' class=('lazy',) data-original='//wimg.588ku.com/gif/20/03/13/77228100e63596838d01968358219e5e.gif?imageView2/2/w/277' src='//js.588ku.com/comp/base/images/lz.gif' title='春暖花开战役胜利'>\n",
      "<Element 'img' alt='移动箭头' class=('lazy',) data-original='//wimg.588ku.com/gif/20/03/17/58f59b50fd48f6ccb9ba8b02b225c54c.gif?imageView2/2/w/277' src='//js.588ku.com/comp/base/images/lz.gif' title='移动箭头'>\n",
      "<Element 'img' alt='春天来临太阳对我笑' class=('lazy',) data-original='//wimg.588ku.com/gif/19/11/25/80d9e1125cdc9294dd672ac475a06baa.gif?imageView2/2/w/277' src='//js.588ku.com/comp/base/images/lz.gif' title='春天来临太阳对我笑'>\n",
      "<Element 'img' alt='工作总结' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/18/88f38185b5b4de4dc79f4e90182c4238.png!/fw/316/clip/316x516a0a0' src='//js.588ku.com/comp/base/images/lz.gif' title='工作总结'>\n",
      "<Element 'img' alt='科技风' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/19/12/09/e891b1fdc1746ca8b82f4ee98864a4c6.png!/fw/316/clip/316x516a0a0' src='//js.588ku.com/comp/base/images/lz.gif' title='科技风'>\n",
      "<Element 'img' alt='医疗防护' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/18/fef9a571db1239c5016e4b803ba7fdce.png!/fw/316/clip/316x516a0a0' src='//js.588ku.com/comp/base/images/lz.gif' title='医疗防护'>\n",
      "<Element 'img' alt='中国风' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/18/84093e8521a7edd879c173a554bc2f52.png!/fw/316/clip/316x516a0a0' src='//js.588ku.com/comp/base/images/lz.gif' title='中国风'>\n",
      "<Element 'img' alt='' class=('img', 'lazy') src='//js.588ku.com/comp/base/images/lz.png'>\n",
      "<Element 'img' alt='春天的希望' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/16/7c2a6e772b9feed79a4ab107dbb1050a.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='春天的希望'>\n",
      "<Element 'img' alt='学习生活' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/17/9171065e07313606281fee22b14cc034.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='学习生活'>\n",
      "<Element 'img' alt='城市建筑' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/19/10/15/1d22429e6c1df917275ba30cf49d486c.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='城市建筑'>\n",
      "<Element 'img' alt='护肤生活' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/21/e953181340e14ecb6bb6e63f26683324.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='护肤生活'>\n",
      "<Element 'img' alt='商务办公' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/01/18/934bef52b6908ff27966bde3e1fc33ad.png!/fw/654/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='商务办公'>\n",
      "<Element 'img' alt='金融' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/19/2114cb06ea978f488d127f4be54bf290.png!/fw/654/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='金融'>\n",
      "<Element 'img' alt='电商图标' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/19/10/29/2477d0be8bf31c83903b88e3ad8814c0.png!/fw/316/clip/316x516a0a0/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='电商图标'>\n",
      "<Element 'img' alt='抗击疫情' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/11/b51894382d5c7ef453fd6a60c5a6be96.png!/fw/316/clip/316x516a0a0/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='抗击疫情'>\n",
      "<Element 'img' alt='APP套图' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/09/9dddd461bee3c24310be71f02faee6d1.png!/fw/316/clip/316x516a0a0/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='APP套图'>\n",
      "<Element 'img' alt='智能电视界面' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/01/07/0a614b000c166f6bb29e42e5b1f9bff9.png!/fw/316/clip/316x516a0a0/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='智能电视界面'>\n",
      "<Element 'img' alt='' class=('small-img', 'lazy') src='//js.588ku.com/comp/base/images/lz.png'>\n",
      "<Element 'img' alt='' class=('small-img', 'lazy') src='//js.588ku.com/comp/base/images/lz.gif'>\n",
      "<Element 'img' alt='通用·春天' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/15/d941f4a5c70e2437b44e276cd74047be.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='通用·春天'>\n",
      "<Element 'img' alt='通用·学习' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/02/19/90f5b861ae09985c60b9418e1c7ac719.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='通用·学习'>\n",
      "<Element 'img' alt='热点·愚人节' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/23/8d81bba7e62d04d931afd7097b8c65e1.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='热点·愚人节'>\n",
      "<Element 'img' alt='热点·清明节' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/20/03/21/7689035ac6aa45fb6e7de31d6e804525.png!/fw/316/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='热点·清明节'>\n",
      "<Element 'img' alt='通用·水墨' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/19/09/02/da45ee7689017d73261befd6281ffa8f.png!/fw/654/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='通用·水墨'>\n",
      "<Element 'img' alt='通用·金融科技' class=('lazy',) data-original='//bpic.588ku.com/ad_diversion/19/09/02/571c6c88df7fcf69478861df0a40f52d.png!/fw/654/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='通用·金融科技'>\n",
      "<Element 'img' alt='1080P海平线浪花夕阳落日实拍' class=('lazy',) data-original='//bpic.588ku.com/video_listen/588ku_pic/19/11/08/27667a361f5c8b0c215521da2a3e8a45.jpg!/fw/430/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='1080P海平线浪花夕阳落日实拍'>\n",
      "<Element 'img' alt='原创武汉疫情宣传片ae模板' class=('lazy',) data-original='//bpic.588ku.com/video_listen/588ku_pic/20/03/05/fed9d2846b1a4daa8699ba3be2fabe53.jpg!/fw/430/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='原创武汉疫情宣传片ae模板'>\n",
      "<Element 'img' alt='大气战疫旗帜背景展示AE模板' class=('lazy',) data-original='//bpic.588ku.com/video_listen/588ku_pic/20/02/18/c54cd96421e2cd9209df22067e1da655.jpg!/fw/430/quality/99/unsharp/true/compress/true' src='//js.588ku.com/comp/base/images/lz.gif' title='大气战疫旗帜背景展示AE模板'>\n",
      "<Element 'img' class=() src='https://vfine.oss-cn-beijing.aliyuncs.com/default/sunset-evening-sky-afterglow-clouds-62312.png'>\n",
      "<Element 'img' src='https://vfine.oss-cn-beijing.aliyuncs.com/default/sunset-evening-sky-afterglow-clouds-62312.png'>\n",
      "<Element 'img' class=() src='https://vfine.oss-cn-beijing.aliyuncs.com/default/pexels-photo-265907.png'>\n",
      "<Element 'img' src='https://vfine.oss-cn-beijing.aliyuncs.com/default/pexels-photo-265907.png'>\n",
      "<Element 'img' class=() src='https://vfine.oss-cn-beijing.aliyuncs.com/default/pexels-photo-197330.png'>\n",
      "<Element 'img' src='https://vfine.oss-cn-beijing.aliyuncs.com/default/pexels-photo-197330.png'>\n",
      "<Element 'img' class=('lazy',) data-original='//static.588ku.com/imgPath/index/images/1902/logos/jrtt.svg' src='//js.588ku.com/comp/base/images/lz.gif'>\n",
      "<Element 'img' class=('lazy',) data-original='//static.588ku.com/imgPath/index/images/1902/logos/ctrio-logo.svg' src='//js.588ku.com/comp/base/images/lz.gif'>\n",
      "<Element 'img' class=('lazy',) data-original='//static.588ku.com/imgPath/index/images/1902/logos/huawei-logo.svg' src='//js.588ku.com/comp/base/images/lz.gif'>\n",
      "<Element 'img' class=('lazy',) src='//static.588ku.com/imgPath/index/images/1902/logos/sf-logo.svg'>\n",
      "<Element 'img' alt='千库网' src='//static.588ku.com/imgPath/index/images/1902/qianku_logoV4.svg' title='千库网'>\n",
      "<Element 'img' src='//js.588ku.com/comp/public/images/wx-qrod.jpg'>\n",
      "<Element 'img' src='//static.588ku.com/comp/public/images/beianico.png'>\n",
      "<Element 'img' class=('lazy',) data-original='//static.588ku.com/imgPath/index/images/safe.svg' src='//static.588ku.com/imgPath/index/images/safe.svg' style='height: 38px; display: inline; vertical-align: middle;' target='_blank'>\n",
      "<Element 'img' class=('lazy',) data-original='//static.588ku.com/imgPath/index/images/industry.svg' src='//static.588ku.com/imgPath/index/images/industry.svg' style='height: 38px; display: inline; vertical-align: middle; margin-left:2px;'>\n",
      "<Element 'img' alt='' src='//js.588ku.com/comp/public/images/login-img1.jpg?v=190905' style='height: 380px;position: absolute;top: 0;left: 0;'>\n",
      "<Element 'img' alt='' src='//js.588ku.com/comp/public/images/login-img1.jpg?v=190905' style='height: 380px;position: absolute;top: 0;left: 0;'>\n",
      "<Element 'img' alt='' src='//js.588ku.com/comp/public/images/login-img1.jpg?v=191226' style='height: 380px;position: absolute;top: 0;left: 0;'>\n",
      "<Element 'img' alt='' src='//static.588ku.com/imgPath/public/images/sidebar-compvip-1.svg'>\n",
      "<Element 'img' alt='' src='//static.588ku.com/imgPath/public/images/sidebar-compvip-2.svg'>\n",
      "<Element 'img' alt='' src='//static.588ku.com/imgPath/public/images/sidebar-compvip-3.svg'>\n",
      "<Element 'img' alt='' src='//static.588ku.com/imgPath/public/images/sidebar-compvip-4v2.svg' width='36'>\n",
      "<Element 'img' src='//static.588ku.com/imgPath/public/images/wx-qrCodeV1.png'>\n",
      "<Element 'img' alt='' class=('adv-close-img',) src='//static.588ku.com/imgPath/public/images/close-time.png'>\n"
     ]
    }
   ],
   "source": [
    "from requests_html import HTMLSession\n",
    "session =HTMLSession()\n",
    "# 使用requests库发起get请求，括号内（）填写需要爬取内容的地址\n",
    "r =session.get(\"https://588ku.com/\")\n",
    "items = r.html.find('img')#使用css选择器选择属性NewCont下面的所有img标签的内容\n",
    "#结果输出：\n",
    "for url in items:\n",
    "    print(url)  # 获得图片src url\n",
    "   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "3、抓取图片"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src=\"https://tse1-mm.cn.bing.net/th/id/OET.b64f52dae61c45e7abc3e7e9f0e32978?w=272&h=135&c=7&rs=1&o=5&pid=1.9\" alt=\"\">"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from IPython.core.display import display, HTML\n",
    "display(HTML('<img src=\"https://tse1-mm.cn.bing.net/th/id/OET.b64f52dae61c45e7abc3e7e9f0e32978?w=272&h=135&c=7&rs=1&o=5&pid=1.9\" alt=\"\">'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
